package com.hellobike.haxing.modules.coupon.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hellobike.haxing.modules.product.mapper.typehandler.JSONArrayHandler;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 券包
 * @Author: haxing-boot
 * @Date: 2020-02-01
 * @Version: V1.0
 */
@Data
@TableName(value = "t_coupon_package", autoResultMap = true)
public class CouponPackage implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 券包名称
     */
    @Excel(name = "券包名称", width = 15)
    private String name;
    /**
     * 包含的优惠券id列表
     */
    @Excel(name = "包含的优惠券id列表", width = 15)
    @TableField(typeHandler = JSONArrayHandler.class)
    private JSONArray couponIds;


    @TableField(typeHandler = JSONArrayHandler.class)
    private JSONArray couponInfo;
    /**
     * 最大发行量
     */
    @Excel(name = "最大发行量", width = 15)
    private Integer maxNum;
    /**
     * 已发行量
     */
    @Excel(name = "已发行量", width = 15)
    private Integer sendedNum;
    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 修改时间
     */
    @Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建人
     */
    @Excel(name = "创建人", width = 15)
    private Long createBy;
    /**
     * 修改人
     */
    @Excel(name = "修改人", width = 15)
    private Long updateBy;
    /**
     * 是否删除：0-否 1-是
     */
    @Excel(name = "是否删除：0-否 1-是", width = 15)
    @TableLogic
    private Integer deleted;
}
